export default function Toast(msg) {
  let toastElement = document.createElement("div");
  toastElement.setAttribute("id", "toast");
  toastElement.innerHTML = msg;
  document.body.appendChild(toastElement);
  toastElement.style.position = 'fixed';
  toastElement.style.top = '50%';
  toastElement.style.left = '50%';
  toastElement.style.transform = 'translate(-50%, -50%)';
  toastElement.style.background = 'rgba(0,0,0,0.6)';
  toastElement.style.borderRadius = '6px';
  toastElement.style.color = '#ffffff';
  toastElement.style.fontSize = '13px';
  toastElement.style.padding = '5px 12px';
  toastElement.style.zIndex = '999';
  setTimeout( () => {
    let el = document.getElementById("toast");
    document.body.removeChild(el);
  },1000);
}
